home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / cenvid / prntscrn.bat < prev    next >
DOS Batch File  |  1995-04-07  |  1KB  |  53 lines

  1. @echo off
  2. REM ********************************************************************
  3. REM *** PrntScrn.bat - Two methods of sending the screen to the      ***
  4. REM *** ver.2          printer.  One method uses the BIOS interrupt  ***
  5. REM ***                as used by pressing the PrtScr key.  The      ***
  6. REM ***                The other method reads the text of the screen ***
  7. REM ***                with CEnvi routines and prints that.          ***
  8. REM ********************************************************************
  9.  
  10. CEnviD %0.bat %1 %2 %3 %4 %5
  11. GOTO CENVI_EXIT
  12.  
  13. Instruction()
  14. {
  15.    puts(``)
  16.    puts(`PrntScrn - Print screen contents to standard printer device`)
  17.    puts(``)
  18.    puts(`USAGE: PrntScrn < BIOS | SMART >`)
  19.    puts(``)
  20.    puts(`WHERE: BIOS: Use bios call; identical to pressing PrintScreen key`)
  21.    puts(`       SMART: Read text contents of screen and print text contents`)
  22.    puts(`              using standard CEnvi calls`)
  23.    puts(``)
  24.    puts(`EXAMPLE: PrntScrn BIOS`)
  25.    puts(`         PrntScrn SMART`)
  26.    puts(``)
  27.    exit(EXIT_FAILURE);
  28. }
  29.  
  30. main(argc,argv)
  31. {
  32.    if ( 2 != argc ||
  33.         (stricmp(argv[1],"BIOS") && stricmp(argv[1],"SMART")) )
  34.       Instruction();
  35.    if ( !stricmp(argv[1],"BIOS") )
  36.       BiosPrintScreen();
  37.    else
  38.       SmartPrintScreen();
  39. }
  40.  
  41. BiosPrintScreen()
  42. {
  43.    reg.ah = 0;
  44.    interrupt(0x05,reg);
  45. }
  46.  
  47. SmartPrintScreen()
  48. {
  49.    system("ScrnSave.bat PRN");
  50. }
  51.  
  52. :CENVI_EXIT
  53.